package main


import (
"fmt"
)


type State int

const (
   Master State=iota
   Slave
   None
)

func leixingFind(a interface{} ){
   defer func(){  e:= recover(); fmt.Println("error" , e)}()
   if a.(State) == Master {
     fmt.Println("ok")
   }
}

type Node struct{
    next *Node
    value interface{}
}

type List struct{
    p *Node
}

func (l *List)Add(in interface{}){
    q := l.p

	  s:= new(Node)
	  s.next = nil
	  s.value = in
    
       if q == nil {

          l.p = s
          return
       }

    for {  

       if q.next == nil {
          q.next = s
          return
       }
       q = q.next
    }
}

func (l *List)Show(){
    q := l.p
    for {
      if q!=nil{
        fmt.Println(q.value,11111)
        q = q.next 
        continue         
      }
      return
    }
}


func main(){

   z := &List{p:nil}
   z.Add(1)
   z.Add(2)
   z.Add(3)
   z.Show()
}





